package cn.szabadsag.org.service.impl;

import cn.szabadsag.base.service.impl.BaseServiceImpl;
import cn.szabadsag.org.domain.Employee;
import cn.szabadsag.org.mapper.EmployeeMapper;
import cn.szabadsag.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author yangcong
 * @date 2022年03月04日 17:27
 * @since
 */
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {


    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 批量删除
     * @param ids
     */
    @Override
    @Transactional
    public void patchDel(Long[] ids) {
        employeeMapper.patchDel(ids);
    }

    /**
     * 激活用户
     * @param id
     */
    @Override
    public void activeEmployee(Long id) {
        Employee employee = employeeMapper.loadById(id);
        employee.setState(1);
        employeeMapper.update(employee);
    }
}
